class Animal{
    public String name;
    public int age;
   /* public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }*/
    public void eat(){
        System.out.println(name+" 正在吃饭！");
    }
}
class Dog extends Animal{
   /* public Dog(String name, int age) {
        super(name, age);
    }*/
    @Override
    public void eat() {
        System.out.println(name+" 正在吃狗粮");
    }
    public void wangwang(){
        System.out.println(name+" 正在汪汪叫");
    }
}
class Brid extends Animal{
   /* public Brid(String name, int age, String wing) {
        super(name, age);
        this.wing = wing;
    }
*/
    @Override
    public void eat() {
        System.out.println(name+" 正在吃鸟粮");
    }
    public String wing;
    public void fly(){
        System.out.println(name+" 正在飞！");
    }
}
public class Test {
  /*  public static void func(Animal animal){
    }
    public static Animal func(){
        return new Dog();
    }
*/
    /*public static void main(String[] args) {
        Animal a =func();
        System.out.println(a.name);
        System.out.println(a.age);
    }*/
   /* public static void main2(String[] args) {
        Dog dog = new Dog();
        func();
    }*/
    public static void main(String[] args) {
        Animal animal = new Dog();
        animal.name = "大黄";
        animal.eat();
        System.out.println("===============");
        Animal animal2 = new Brid();
        animal2.name = "圆圆";
        animal.eat();
        //animal.wangwang();
    }
    public static void main3(String[] args) {
        Dog dog = new Dog();
        dog.name = "大黄";
        dog.eat();
        //Animal animal = dog;//他们是在继承关系上

        Brid brid =new Brid();
        brid.name = "圆圆";
        //Animal animal2 = brid;
        brid.eat() ;
    }
}
